package com.ljwm.seckill.service;

import com.ljwm.seckill.dto.Exposer;
import com.ljwm.seckill.dto.SeckillExecution;
import com.ljwm.seckill.entity.Seckill;
import com.ljwm.seckill.exception.RepeatKillException;
import com.ljwm.seckill.exception.SeckillCloseException;
import com.ljwm.seckill.exception.SeckillException;

import java.util.List;

/**
 * Created by yuzhou on 2017/8/6.
 */
public interface SeckillService {

  /**
   * 查询所有秒杀记录
   * @return
   */
  List<Seckill> getSeckillList();

  /**
   * 查询单个秒杀记录
   * @param seckillId
   * @return
   */
  Seckill getById(Long seckillId);

  /**
   * 输出秒杀接口地址
   * @param seckillId
   * @return
   */
  Exposer exportSeckillUrl(Long seckillId);

  SeckillExecution executeSeckill(Long seckillId, Long userPhone, String md5)
    throws SeckillException, RepeatKillException, SeckillCloseException;
}
